package com.shenmazong.serveredustudent.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shenmazong.serveredustudent.mapper.TbCollageMapper;
import com.shenmazong.serveredustudent.mapper.TbStudentMapper;
import com.shenmazong.serveredustudent.pojo.TbApply;
import com.shenmazong.serveredustudent.pojo.TbCollage;
import com.shenmazong.serveredustudent.pojo.TbStudent;
import com.shenmazong.serveredustudent.service.TbApplyService;
import com.shenmazong.serveredustudent.mapper.TbApplyMapper;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.ListParamVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 *
 */
@Service
public class TbApplyServiceImpl extends ServiceImpl<TbApplyMapper, TbApply>
    implements TbApplyService{

    @Autowired
    private TbApplyMapper applyMapper;


    @Override
    public ResultResponse getApplyPage(ListParamVo listParamVo) {

        Page<TbApply> page = new Page<>(listParamVo.getCurrent(), listParamVo.getSize());

        Map<String, Object> paramMap = listParamVo.getParamMap();

        String collageId =(String) paramMap.get("collageId");

        LambdaQueryWrapper<TbApply> eq = new QueryWrapper<TbApply>().lambda().eq(TbApply::getCollageId, collageId);

        Page<TbApply> page1 = applyMapper.selectPage(page, eq);

        return ResultResponse.SUCCESS(page1);

    }
}




